#include "PrecompiledHeader.h"
#include "TextureRes.h"

/*--------------------------------------------------------------------------*/

TextureRes::TextureRes(const std::string& name, const std::string& path) :
	IResource("TextureRes:" + path)
{
	this->m_path = path;
	this->m_size = glm::ivec2(-1, -1);
	this->m_texture = ROpenGL::GenTexture(name, path);
}

/*--------------------------------------------------------------------------*/

TextureRes::~TextureRes()
{
	if (this->m_texture)
	{
		ROpenGL::DeleteTexture(&this->m_texture);
	}
}

/*--------------------------------------------------------------------------*/

void TextureRes::Reload()
{

}

/*--------------------------------------------------------------------------*/

const std::string& TextureRes::GetPath() const
{
	return this->m_path;
}

/*--------------------------------------------------------------------------*/

GLTexture* TextureRes::GetTexture()
{
	return this->m_texture;
}

/*--------------------------------------------------------------------------*/

const glm::ivec2& TextureRes::GetSize() const
{
	return this->m_size;
}

/*--------------------------------------------------------------------------*/